using UnityEngine;

namespace Fur.Scripts
{
    public class MoveAndRotateObject : MonoBehaviour
    {
        [SerializeField] float speed = 180;
        [SerializeField] Vector3 scale = Vector3.one;
        private float _angle = 0f;
        private Vector3 _axis;
        private Vector3 _center;

        void Start()
        {
            _axis = Random.insideUnitSphere;
            _center = transform.position;
        }

        void Update()
        {
            _angle += speed * Time.deltaTime;
            transform.rotation = Quaternion.AngleAxis(_angle, _axis);
            transform.position = _center + new Vector3(
                scale.x * Mathf.Sin(Time.time * Mathf.PI * 0.5f),
                scale.y * Mathf.Cos(Time.time * Mathf.PI * 0.2f),
                scale.z * Mathf.Cos(Time.time * Mathf.PI * 0.3f));
        }
    }
}